<?php
/**
 * Created by PhpStorm.
 * User: yancheng (cheng@love.xiaoyan.me)
 * Date: 14-8-22
 * Time: 下午12:52
 */
global $runData;
$runData = array('db' => null);

function getDB()
{
    global $runData;
    if ($runData['db']) {
        return $runData['db'];
    }
	$dbc = RouterCore::getInstance()->getConf('db_config');
	$env = $_SERVER['HTTP_HOST'] == 'user_center.jd-app.com' ? 'jd' :'local';
    $db = new medoo($dbc[$env]);
    $runData['db'] = $db;
    return $db;
}



